<template>
  <div class="map">
    <div class="mapText">
      <div class="block" v-for="(item, index) in place" :key="index" :style="{ left: item.left, top: item.top }">
        <div class="icon"></div>
        <div class="text">{{ item.name }}</div>
      </div>
      <img class="mapImg" src="@/assets/datav/map.png" alt="" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'map',
  data() {
    return {
      place: [
        {
          name: this.$t('xiAn'),
          left: 521,
          top: 257,
        },
        {
          name: this.$t('wuLuMuQi'),
          left: 433,
          top: 200,
        },
        {
          name: this.$t('jiErJiSiTan'),
          left: 378,
          top: 263,
        },
        {
          name: this.$t('aLaMuTu'),
          left: 367,
          top: 146,
        },
        {
          name: this.$t('aFuHan'),
          left: 310,
          top: 211,
        },
        {
          name: this.$t('tuErQi'),
          left: 224,
          top: 269,
        },
        {
          name: this.$t('luoMaNiYa'),
          left: 179,
          top: 238,
        },
        {
          name: this.$t('moSiKe'),
          left: 280,
          top: 169,
        },
        {
          name: this.$t('baieluoSi'),
          left: 193,
          top: 138,
        },
        {
          name: this.$t('deGuo'),
          left: 123,
          top: 148,
        },
        {
          name: this.$t('lunDun'),
          left: 51,
          top: 183,
        },
        {
          name: this.$t('yiDaLi'),
          left: 104,
          top: 221,
        },
      ],
    };
  },
  methods: {},
  mounted() {
    this.place.forEach((item) => {
      item.left = (item.left / 920) * 100 + '%';
      item.top = (item.top / 542) * 100 + '%';
    });
  },
};
</script>

<style lang="scss" scoped>
.map {
  margin: 0 auto;
}
.mapImg {
  width: 100%;
}
.mapText {
  width: 100%;
  height: 100%;
  position: relative;
  .block {
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    height: 26px;
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.23) 2%, #044a66 49%, rgba(0, 0, 0, 0) 100%);
    position: absolute;
    &::before {
      content: '';
      height: 1px;
      background: linear-gradient(270deg, rgba(255, 255, 255, 0) 2%, #1ef9fd 53%, rgba(255, 255, 255, 0) 100%);
      position: absolute;
      width: 100%;
      left: 0;
      top: 0;
    }

    &::after {
      content: '';
      height: 1px;
      background: linear-gradient(270deg, rgba(255, 255, 255, 0) 2%, #1ef9fd 53%, rgba(255, 255, 255, 0) 100%);
      position: absolute;
      width: 100%;
      left: 0;
      bottom: 0;
    }
    .icon {
      width: 10px;
      height: 10px;
      position: relative;
      margin-right: 4px;
      display: flex;
      justify-content: center;
      align-items: center;
      &::after {
        background: rgba(30, 249, 253, 0.2);
        border-radius: 10px;
        content: '';
        position: absolute;
        z-index: 1;
        width: 100%;
        height: 100%;
      }
      &::before {
        background: #1ef9fd;
        border-radius: 6px;
        content: '';
        position: absolute;
        z-index: 2;
        width: 6px;
        height: 6px;
      }
    }

    .text {
      font-size: 14px;
      text-shadow: 0px 0px 7.3px #ffca38, 0px 1.62px 3.24px #1487de;
    }
  }
}
</style>
